import request from '@/utils/request'
import { praseStrEmpty } from "@/utils/ruoyi";

// 查询图案列表
export function listPattern(query) {
  return request({
    url: '/business/pattern/list',
    method: 'get',
    params: query
  })
}

// 查询图案详细信息
export function getPattern(patternId) {
  return request({
    url: '/business/pattern/' + praseStrEmpty(patternId),
    method: 'get'
  })
}

// 新增图案
export function addPattern(data) {
  return request({
    url: '/business/pattern',
    method: 'post',
    data: data
  })
}

// 修改图案
export function updatePattern(data) {
  return request({
    url: '/business/pattern',
    method: 'put',
    data: data
  })
}

// 删除产品与图案
export function delPattern(patternId) {
  return request({
    url: '/business/pattern/' + patternId,
    method: 'delete'
  })
}

// 导出产品与图案
export function exportPattern(query) {
  return request({
    url: '/business/pattern/export',
    method: 'get',
    params: query
  })
}
